<?php

require_once 'Zend/Controller/Plugin/Abstract.php';

class Ext_Controller_Plugin_Session extends Zend_Controller_Plugin_Abstract
{
    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
        $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/session.ini', APPLICATION_ENV);
        Zend_Session::setOptions($config->toArray());
        $sesseionAutoStart = @ini_get('session.auto_start');
        if(!$sesseionAutoStart){
            Zend_Session::start();
        }
    }
}